<script setup>
import { onMounted, onUnmounted, onUpdated, ref } from 'vue'

console.log('立刻被执行的')

onMounted(() => {
  console.log('onMounted!')
  const h1 = document.querySelector('h1')
  console.log(h1)
})

const count = ref(0)
onUpdated(() => {
  console.log('onUpdated')
})

onUnmounted(() => {
  console.log('onUnmounted')
})
</script>

<template>
  <h1>Hello vue3</h1>
  <h2>{{ count }}</h2>
  <button @click="count++">点击+1</button>
</template>
